package dao.impl;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import module.Houses;
import dao.ABSBasicDAO;
import domain.vo.queryObject;

/**
 * 
* @ClassName: HousesDAOImpl
* @Description: HousesDAO实现类
* @author chenchao
* @date 2013-10-31 上午05:49:08
*
 */
public class HousesDAOImpl extends ABSBasicDAO<Houses> {
	/**
	 * 构造方法
	 * @param sqlMapClient
	 */
	public  HousesDAOImpl(SqlMapClient sqlMapClient) {
		super(sqlMapClient);
	}
	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getAll()
	 */
	@Override
	public List<Houses> getAll() throws SQLException {
		// TODO Auto-generated method stub
		return sqlMapClient.queryForList("Houses.getAll");
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getById(java.lang.String)
	 */
	@Override
	public Houses getById(String id) throws SQLException {
		// TODO Auto-generated method stub
		return (Houses)sqlMapClient.queryForObject("Houses.getById", id);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getByPK()
	 */
	@Override
	public Houses getByPK() {
		// TODO Auto-generated method stub
		return super.getByPK();
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#insertT(java.lang.Object)
	 */
	@Override
	public void insertT(Houses t) throws SQLException {
		sqlMapClient.insert("Houses.insertHouseInfo", t);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#updateT(java.lang.Object)
	 */
	@Override
	public void updateT(Houses t) throws SQLException {
		sqlMapClient.update("Houses.updateHouseInfo", t);
	}
	
	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getObjectByQueryObject(domain.vo.queryObject)
	 */
	@Override
	public List<Houses> getObjectByQueryObject(queryObject queryObject)
			throws SQLException {
		return sqlMapClient.queryForList("Houses.getHouseByQueryObject", queryObject);
	}
	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#countByQueryObject(domain.vo.queryObject)
	 */
	@Override
	public int countByQueryObject(queryObject queryObject) throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) sqlMapClient.queryForObject("Houses.countHouseByQueryObject", queryObject);
	}
	
}
